export function formatDate(date, detail = false) {
    const d = new Date(date)
    const year = d.getFullYear()
    const month = d.getMonth() + 1
    const day = d.getDate()
    const hour = d.getHours()
    const minute = d.getMinutes()
    const second = d.getSeconds()
    if (detail) {
        return `${year}-${month}-${day} ${hour}:${minute}:${second}`
    } else {
        return `${year}-${month}-${day}`
    }
}
